package com.huike.report.service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.huike.clues.domain.vo.cluesStatisticsVo;
import com.huike.common.core.domain.entity.BCStatisticsVo;
import com.huike.common.core.domain.entity.SJStatisticsVo;
import com.huike.report.domain.vo.*;
import org.apache.ibatis.annotations.Param;

import com.huike.clues.domain.TbActivity;
import com.huike.clues.domain.TbClue;
import com.huike.clues.domain.vo.IndexStatisticsVo;
import com.huike.contract.domain.TbContract;

public interface IReportService {

    /**
     *新增客户统计
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    public LineChartVO contractStatistics(String beginCreateTime, String endCreateTime);


    /**
     * 客户统计报表
     * @param tbContract
     * @return
     */
    public  List<TbContract> contractReportList(TbContract tbContract);

    /**
     * 销售统计
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    public LineChartVO salesStatistics(String beginCreateTime, String endCreateTime);



    /**
     * 销售统计部门报表
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    public List<Map<String, Object>> deptStatisticsList(String beginCreateTime, String endCreateTime);

    /**
     * 销售统计渠道报表
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    public List<Map<String, Object>> channelStatisticsList(String beginCreateTime, String endCreateTime);
    /**
     * 销售统计归属人报表
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    public List<Map<String, Object>> ownerShipStatisticsList(String beginCreateTime, String endCreateTime);



    /**
     * 渠道统计
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    public List<Map<String, Object>> chanelStatistics(String beginCreateTime, String endCreateTime);


    /**
     * 活动统计
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    public List<Map<String, Object>> activityStatistics(String beginCreateTime, String endCreateTime);



    public List<TbClue> cluesStatisticsList(TbClue clue);

    /**
     * 活动渠道统计
     * @param activity
     * @return
     */
    public List<ActivityStatisticsVo> activityStatisticsList(TbActivity activity);


    public IndexVo getIndex(IndexStatisticsVo request);


    public List<Map<String,Object>> salesStatisticsForIndex(IndexStatisticsVo request);


    /**
     * 首页基本数据展示
     * @param beginCreateTime
     * @param endCreateTime
     * @return
     */
    IndexBaseInfoVO getBaseInfo(String beginCreateTime, String endCreateTime);

    /**
     * 获取线索数量
     * @return
     */
    Integer getTodayCluesNum(String username, String now);

    /**
     * 获取商机数量
     */
    Integer getTodayBusinessNum(String username, String now);

    /**
     * 获取合同数量
     */
    Integer getTodayContractNum(String username, String now);

    /**
     * 获取销售金额
     */
    Double getTodaySalesAmount(String username, String now);

    /**
     * 获取指定时间段的销售数量
     */
    Integer getCluesNums(String beginCreateTime, String endCreateTime);

    /**
     * 有效线索
     */
    Integer getEffectiveCluesNums(String beginCreateTime, String endCreateTime);

    /**
     * 商机数量
     */
    Integer getBusinessNums(String beginCreateTime, String endCreateTime);

    /**
     * 合同数量
     */
    Integer getContractNums(String beginCreateTime, String endCreateTime);

    /**
     * 商机转化龙虎榜接口
     */
    List<BCStatisticsVo> businessChangeStatistics(String beginCreateTime, String endCreateTime);

    String getDeptName(Integer deptId);
    /**
     * 统计分析-客户统计-学科客户分布饼图
     */
    List<SJStatisticsVo> getSubjectStatistics(String beginCreateTime, String endCreateTime);

    /**
     *待跟进线索数目指线索表
     */
    Integer getTofollowedCluesNum(String beginCreateTime, String endCreateTime);

    /**
     * 待跟进商机数目
     */
    Integer getTofollowedBusinessNum(String beginCreateTime, String endCreateTime);

    /**
     * 待分配线索数目
     */
    Integer getToallocatedCluesNum(String beginCreateTime, String endCreateTime);

    /**
     * 待分配商机数目
     */
    Integer getToallocatedBusinessNum(String beginCreateTime, String endCreateTime);

    /**
     * 新增的线索数量
     */
    List<cluesStatisticsVo> cluesStatistics(String beginCreateTime, String endCreateTime);

    /**
     * 这段时间每一天的线索总数量
     */
    List<cluesStatisticsVo> cluesStatisticsAll(String beginCreateTime, String endCreateTime);
}
